﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Messhall.Framework.Domain.DomainObject;

namespace Messhall.Domain.System.BusinessObjects
{
    public class Role : EntityBoBase
    {
        #region 成员变量

        /// <summary>
        /// 角色名称
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// 菜单权限
        /// </summary>
        public List<RoleMenu> MenuRoles { get; private set; } = new();

        #endregion

        public Role(string name)
        {
            Name = name;
        }

        public void SetName(string name)
        {
            Name = name;
        }

        public void SetMenuRoles(RoleMenu menuRole)
        {
            MenuRoles.Add(menuRole);
        }

        public void RemoveMenuRoles(RoleMenu menuRole)
        {
            MenuRoles.Remove(menuRole);
        }
    }
}
